import axios from "axios";
const instance1 = axios.create({
  baseURL: import.meta.env.VITE_BASE_URL,
  timeout: 3000,
});
instance1.interceptors.request.use(
  (request) => {
    return request;
  },
  (err) => {
    return Promise.reject(err);
  }
);
instance1.interceptors.response.use(
  (response) => {
    if (response.status === 200) {
      return response.data;
    } else {
      response.myErrMsg = "数据响应失败";
      return Promise.reject(response);
    }
  },
  (err) => {
    return Promise.reject(err);
  }
);
export { instance1 };
